Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made key assertion optional for hardcoded issuing authority to avoid the need for minimal wallet server. #825

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

sorotokin
Copy link
Contributor

Since DeviceAssertion validation only makes sense on the server, do not require it when creating credentials using hardcoded issuing authority (which we want to continue working without any servers). Key attestation is still required. In future we can start detecting server environment and require DeviceAssertion only when running on the server, but not in-app.

Tested manually with and without server.

Copy link
Contributor

@halxinate halxinate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential NPE crash.

): List<KeyPossessionChallenge> {
credentialRequestSets.add(CredentialRequestSet(
format = format!!,
keyAttestations = credentialRequests.map { it.secureAreaBoundKeyAttestation },
keysAssertion = keysAssertion
keysAssertion = keysAssertion!!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears the null value is treated as a special forking signal now. But here (and in other similar method that signal would throw RT NPE. Is that as expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forking signal is actually in CredentialConfiguration.keyAssertionRequired. If that is true, keysAssertion must be provided. If it is null, this will throw and at some point will be converted to HTTP status 500 - not the best error code, of course, but we did not do a pass through our APIs to make sure all error codes and messages are what we want them to be.

…the need for minimal wallet server.

Signed-off-by: Peter Sorotokin <[email protected]>
@sorotokin sorotokin merged commit c2045f2 into main Dec 19, 2024
5 checks passed
@sorotokin sorotokin deleted the optional-server branch December 19, 2024 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants